package com.umgsai.thread.thread41;

/**
 * 设置默认值
 * @author Admin
 *
 */
public class ThreadLocalExt extends ThreadLocal {
	public static ThreadLocalExt t1 = new ThreadLocalExt();
	
	@Override
	protected Object initialValue() {
		return "This is the default value";
	}
	
	public static void main(String[] args) {
		if (t1.get() == null) {
			System.out.println("从未放过值");
			t1.set("我的值");
		}
		System.out.println(t1.get());
		System.out.println(t1.get());
	}
}
